package my.geraltigas.week6_springboot.service.impl;

import my.geraltigas.week6_springboot.dao.GoodsDAO;
import my.geraltigas.week6_springboot.entity.Goods;
import my.geraltigas.week6_springboot.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    GoodsDAO goodsDAO;

    @Override
    public List<Goods> list() {
        return goodsDAO.list();
    }

    @Override
    public Goods get(int id) {
        return goodsDAO.get(id);
    }

    @Override
    public int add(Goods goods) {
        return goodsDAO.add(goods);
    }

    @Override
    public int update(Goods goods) {
        return goodsDAO.update(goods);
    }

    @Override
    public int delete(int id) {
        return goodsDAO.delete(id);
    }
}

